16 research outputs found

    Detection of vulnerabilities and automatic protection for web applications

    Get PDF
    Tese de doutoramento, Informática (Ciências da Computação), Universidade de Lisboa, Faculdade de Ciências, 2016In less than three decades of existence, the Web evolved from a platform for accessing hypermedia to a framework for running complex web applications. These applications appear in many forms, from small home-made to large-scale commercial services such as Gmail, Office 365, and Facebook. Although a significant research effort on web application security has been on going for a while, these applications have been a major source of problems and their security continues to be challenged. An important part of the problem derives from vulnerable source code, often written in unsafe languages like PHP, and programmed by people without the appropriate knowledge about secure coding, who leave flaws in the applications. Nowadays the most exploited vulnerability category is the input validation, which is directly related with the user inputs inserted in web application forms. The thesis proposes methodologies and tools for the detection of input validation vulnerabilities in source code and for the protection of web applications written in PHP, using source code static analysis, machine learning and runtime protection techniques. An approach based on source code static analysis is used to identify vulnerabilities in applications programmed with PHP. The user inputs are tracked with taint analysis to determine if they reach a PHP function susceptible to be exploited. Then, machine learning is applied to determine if the identified flaws are actually vulnerabilities. In the affirmative case, the results of static analysis are used to remove the flaws, correcting the source code automatically thus protecting the web application. A new technique for source code static analysis is suggested to automatically learn about vulnerabilities and then to detect them. Machine learning applied to natural language processing is used to, in a first instance, learn characteristics about flaws in the source code, classifying it as being vulnerable or not, and then discovering and identifying the vulnerabilities. A runtime protection technique is also proposed to flag and block injection attacks against databases. The technique is implemented inside the database management system to improve the effectiveness of the detection of attacks, avoiding a semantic mismatch. Source code identifiers are employed so that, when an attack is flagged, the vulnerability is localized in the source code. Overall this work allowed the identification of about 1200 vulnerabilities in open source web applications available in the Internet, 560 of which previously unknown. The unknown vulnerabilities were reported to the corresponding software developers and most of them have already been removed.Em duas décadas de existência, a web evoluiu de uma plataforma para aceder a conteúdos hipermédia para uma infraestrutura para execução de aplicações complexas. Estas aplicações têm várias formas, desde aplicações pequenas e caseiras, a aplicações complexas e de grande escala e para diversos propósitos, como por exemplo serviços comerciais como o Gmail, Office 365 e Facebook. Apesar do grande esforço de investigação da última década em como tornar as aplicações web seguras, estas continuam a ser uma fonte de problemas e a sua segurança um desafio. Uma parte importante deste problema deriva de código fonte vulnerável, muitas vezes desenvolvido com linguagens de programação com poucas validações e construído por pessoas sem os conhecimentos mais adequados para uma programação segura. Atualmente a categoria de vulnerabilidades mais explorada é a de validação de input, diretamente relacionada com os dados (inputs) que os utilizadores inserem nas aplicações web. A tese propõe metodologias para a detecção e remoção de vulnerabilidades no código fonte e para a proteção das aplicações web em tempo de execução, empregando técnicas como a análise estática de código, aprendizagem máquina e protecção em tempo de execução. Numa primeira fase, a análise estática é utilizada para descobrir e identificar vulnerabilidades no código programado na linguagem PHP. Os inputs dos utilizadores são rastreados e é verificado se estes são parâmetros de funções PHP susceptíveis de serem exploradas. A combinação desta técnica com a aprendizagem máquina aplicada em minerização de dados é proposta para prever se as vulnerabilidades detectadas são falsos positivos ou reais. Caso sejam reais, o resultado da análise estática de código é utilizado para eliminá-las, corrigindo o código fonte automaticamente com fixes (remendos) e protegendo assim as aplicações web. A tese apresenta também uma nova técnica de análise estática de código para descobrir vulnerabilidades. A técnica aprende o que é código vulnerável e depois tira partido desse conhecimento para localizar problemas. A aprendizagem máquina aplicada ao processamento de linguagem natural é utilizada para, numa primeira instância, aprender aspectos que caracterizam as vulnerabilidades, para depois processar e analisar o código fonte, classificando-o como sendo ou não vulnerável, descobrindo e identificando os erros. Numa terceira fase, é proposta uma nova técnica de proteção em tempo de execução para descobrir e bloquear ataques de injeção contra bases de dados. A técnica é concretizada dentro do sistema de gestão de bases de dados para melhorar a eficácia na detecção dos ataques. É utilizada conjuntamente com identificadores de código fonte que, quando um ataque é sinalizado, permitem identificar a vulnerabilidade no programa. No total este trabalho permitiu a identificação de cerca de 1200 vulnerabilidades em aplicações web de código aberto disponíveis na Internet, das quais 560 eram até então desconhecidas. As vulnerabilidades desconhecidas foram reportadas aos autores do software onde foram encontradas e muitas delas já foram removidas

    Detecção de vulnerabilidades de inteiros na adaptação de software de 32 para 64 bits

    Get PDF
    Tese de mestrado em Informática, apresentada à Universidade de Lisboa, através da Faculdade de Ciências, 2007Os processadores de 64 bits, comercializados por fabricantes como a Intel e a AMD, começaram a equipar os mais recentes computadores, sendo muito do software neles executado desenvolvido inicialmente para arquitecturas de 32 bits. As aplicações concebidas na linguagem de programação C para a arquitectura de 32 bits, ao serem portadas para 64 bits, podem ficar com vulnerabilidades relacionadas com a manipulação de inteiros. Esta tese estuda as vulnerabilidades que podem surgir quando se adapta ( porta ) sem os necessários cuidados software de 32 para 64 bits, considerando o modelo de dados LP64, muito utilizado em software de código aberto. Também propõe a ferramenta DEEEP que faz a detecção dessas vulnerabilidades através de análise estática de código fonte. A ferramenta é baseada em duas ferramentas de análise estática de código, de código aberto, que são utilizadas para encontrar bugs na manipulação de inteiros, através de verificação de tipos, e para fazer análise de fluxo de dados, para verificar se funções perigosas (p.ex., memcpy, strcpy) estão acessíveis de fora do programa. Após estas duas formas de análise, a ferramenta DEEEP correlaciona a informação delas resultante, identificando se os bugs encontrados são realmente vulnerabilidades, ou seja, se são atacáveis. São apresentados resultados experimentais da utilização da ferramenta com código vulnerável sintético, criado especificamente para avaliar a ferramenta, e com diversos pacotes de código aberto.64-bit processors, available from manufacturers such as Intel and AMD, started to equip many recent computers, but much of the software running in them has initially been developed for 32-bit architectures. Applications designed in the C programming language for 32-bit architecture when adapted to 64 bits can show vulnerabilities related to integer handling. This thesis studies the vulnerabilities that can arise when porting software from 32 to 64 bits without the necessary care, considering the LP64 data model, widely used in open source software. This thesis also proposes the DEEEP, a tool that detects these vulnerabilities through static analysis of source code. The tool is based on two open source static analysis tools. Type checking is used for finding bugs on the way integers are handled, and data-flow analysis is used to see if hazardous functions (eg. memcpy, strcpy) are accessible from outside the program. After these two forms of analysis, the DEEEP tool correlates their outputs, identifying if the found bugs are really vulnerabilities, i. e., if they are attackable. The tool was evaluated using synthetic code and several open source packages, like Sendmail

    On Combining Diverse Static Analysis Tools for Web Security: An Empirical Study

    Get PDF
    Developers frequently rely on free static analysis tools to automatically detect vulnerabilities in the source code of their applications, but it is well-known that the performance of such tools is limited and varies from one software development scenario to another, both in terms of coverage and false positives. Diversity is an obvious direction to take to improve coverage, as different tools usually report distinct vulnerabilities, but this may come with an increase in the number of false alarms. In this paper,we study the problem of combining diverse static analysis tools to detect web vulnerabilities, considering four software development scenarios with different goals and constraints, ranging from low budget to high-end (e.g., business critical) applications. We conducted an experimental campaign with five free static analysis tools to detect vulnerabilities in a workload composed by 134 WordPress plugins. Results clearly show that the best solution depends on the development scenario. Furthermore, in some cases, a single tool performs better than the best combination of tools

    Detecção de Vulnerabilidades de Inteiros na Adaptação de Software de 32 para 64 Bits

    No full text
    Os processadores de 64 bits, comercializados por fabricantes como a Intel e a AMD, começaram a equipar os mais recentes computadores, sendo muito do software neles executado desenvolvido inicialmente para arquitecturas de 32 bits. As aplicações concebidas na linguagem de programação C para a arquitectura de 32 bits, ao serem portadas para 64 bits, podem ficar com vulnerabilidades relacionadas com a manipulação de inteiros. Esta tese estuda as vulnerabilidades que podem surgir quando se adapta ("porta") sem os necessários cuidados software de 32 para 64 bits, considerando o modelo de dados LP64, muito utilizado em software de código aberto. Também propõe a ferramenta DEEEP que faz a detecção dessas vulnerabilidades através de análise estática de código fonte. A ferramenta é baseada em duas ferramentas de análise estática de código, de código aberto, que são utilizadas para encontrar bugs na manipulação de inteiros, através de verificação de tipos, e para fazer análise de fluxo de dados, para verificar se funções perigosas (p.ex., memcpy, strcpy) estão acessíveis de fora do programa. Após estas duas formas de análise, a ferramenta DEEEP correlaciona a informação delas resultante, identificando se os bugs encontrados são realmente vulnerabilidades, ou seja, se são atacáveis. São apresentados resultados experimentais da utilização da ferramenta com código vulnerável sintético, criado especificamente para avaliar a ferramenta, e com diversos pacotes de código abert

    Securing Energy Metering Software with Automatic Source Code Correction

    No full text
    Abstract—Industry is using power meters to monitor the consumption of energy and achieving cost savings. This monitoring often involves energy metering software with a web interface. However, web applications often have vulnerabilities that can be exploited by cyber-attacks. We present an approach and a tool to solve this problem by analyzing the application source code and automatically inserting fixes to remove the discovered vulnerabilities. We demonstrate the use of the tool with two open source energy metering applications in which it found and corrected 17 vulnerabilities. By looking in more detail into some of these vulnerabilities, we argue that they are very serious, leading to the following impacts: violation of user privacy, counter the benefits of energy metering, and serve as entering points for attacks on other user software. I

    WAP: Automatic detection and correction of web application vulnerabilities

    No full text
    Web application security is an important problem in today’s internet. A major cause of this status is that many programmers do not have adequate knowledge about secure coding, so they leave applications with vulnerabilities. An approach to solve this problem is to use source code static analysis to find these bugs, but these tools are known to report many false positives that make hard the task of correcting the application. This paper explores the use of a hybrid of methods to detect vulnerabilities with less false positives. After an initial step that uses taint analysis to flag candidate vulnerabilities, our approach uses data mining to predict the existence of false positives. This approach reaches a trade-off between two apparently opposite approaches: humans coding the knowledge about vulnerabilities (for taint analysis) versus automatically obtaining that knowledge (with machine learning, for data mining). Given this more precise form of detection, we do automatic code correction by inserting fixes in the source code. The approach was implemented in the WAP tool 1 and an experimental evaluation was performed with a large set of open source PHP applications

    Web Application Protection with the WAP Tool

    No full text
    Abstract—In two decades the web became a standard framework for Internet applications. This involved changing from an initially simple hypermedia access platform to a complex blob of different technologies. This complexity associated to the increasing filtering of TCP/UDP ports everywhere in the Internet, turned web applications into favourite targets for cyber-criminals. The Web Application Protection (WAP) tool aims to secure web applications by analysing and automatically fixing their source code [1] 1. WAP currently handles PHP code, in which most web applications are written. As of April 2014, WAP has been used to process more than 1.5 million lines of code. This short paper briefly presents the tool and ongoing work on evolving it. I. THE WAP APPROACH The WAP approach brings to source code analysis a tension observed in Intrusion Detection Systems (IDSs). These systems have been classified in two main categories. Knowledge-based IDSs contain a database of attack signatures created manually by human beings. Behaviour-based IDSs, on the contrary, learn about attacks – or normal behaviour – automatically using labelled data sets. Our approach uses a hybrid of two analog approaches. WAP searches for input validation vulnerabilities in PHP source code: cross-site scripting (XSS), SQL injection, remote and local file inclusion, path traversal, OS command injection, and a few more. First, the tool has knowledge crafted manually about how to find these vulnerabilities. More specifically, it does taint analysis: it verifies if inputs can reach sensitive functions (sensitive sinks) without proper sanitisation or validation (taint analysis in Fig. 1). The lists of input entry points, sensitive sinks, and sanitisation/validation functions are produced by humans. Examples for XSS are in Table I Entry points Sensitive sinks Sanitisation functions GETechohtmlentities GET echo htmlentities POST print htmlspecialchars COOKIEprintfstriptags COOKIE printf strip tags REQUEST die urlencod
    corecore